import www.orm, sys
from www.models import Blog, User, Comment
import asyncio


async def test(loop):
    await www.orm.create_pool(loop, user='root', password='', database='awesome',host='127.0.0.1',port=3306, charset='utf8')
    u = User(name='Test', email='test5@example.com', passwd='123456', image='about:blank', admin=False)
    await u.save()


loop = asyncio.get_event_loop()

loop.run_until_complete(test(loop))

loop.close()

if loop.is_closed():
    sys.exit(0)
